package com.cwx.interfaces;

import com.cwx.utils.HttpUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by code on 17-8-31.
 */
public class Interface98 {

    public static final String prefixUrl = "http://fly.98zhengxin.com/API";

    public static final Map<String,String> headers = new HashMap();

    static {
        headers.put("COMPANY_KEY","FGFK12BHBYSAZDQB0");
        headers.put("COMPANY_CODE","6FEC3C1838124766884967FDD639909E");
    }

    /**
     * 身份实名
     * @param name
     * @param idCard
     * @return
     */
    public static String idCardSimple(String name,String idCard) throws IOException {
        String urlStr = prefixUrl + "/idCardSimple";
        StringBuffer sb = new StringBuffer(urlStr);
        sb.append("?name=").append(name).append("&idcard=").append(idCard);
        return HttpUtils.get(headers,sb.toString());
    }

    /**
     * 银行卡四要素
     * @param name
     * @param idCard
     * @param phone
     * @param bankCard
     * @return
     */
    public static String bankCardFourAPI(String name,String idCard,String phone,String bankCard) throws IOException {
        String urlStr = prefixUrl + "/bankCardFourAPI";
        StringBuffer sb = new StringBuffer(urlStr);
        sb.append("?name=").append(name).append("&idcard=").append(idCard).append("&bankcard=").append(bankCard).append("&mobileNo=").append(phone);
        return HttpUtils.get(headers,sb.toString());
    }

    public static void main(String[] args) throws IOException {
        System.out.println(Interface98.idCardSimple("李刚","37292219951029391X"));
    }

}
